x86/emulator: workaround for AMD erratum 573
authorJan Beulich <jbeulich@suse.com>
Fri, 16 Dec 2011 14:45:40 +0000 (15:45 +0100)
committerJan Beulich <jbeulich@suse.com>
Fri, 16 Dec 2011 14:45:40 +0000 (15:45 +0100)
commita1b22e625dee30b9ca572e5b7fe66f1aebd44d7d
tree3284bfa225b3b7e5716d3aede98720684e1f46f0
parent6e359548a1c9afdaee765ccd8b9635424acdb1bd
x86/emulator: workaround for AMD erratum 573

The only cases where we might end up emulating fsincos (as any other
x87 operations without memory operands) are
- when a HVM guest is in real mode (not applicable on AMD)
- between two half page table updates in PAE mode (unlikely, and not
  doing the emulation here does affect only performance, not
  correctness)
- when a guest maliciously (or erroneously) modifies an (MMIO or page
  table update) instruction under emulation (unspecified behavior)

Hence, in order to avoid the erratum to cause harm to the entire host,
don't emulate fsincos on the affected AMD CPU families.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
tools/tests/x86_emulator/x86_emulate.c
xen/arch/x86/x86_emulate.c
xen/arch/x86/x86_emulate/x86_emulate.c
xen/include/asm-x86/amd.h